package oop;

public class ReturnT {
    public int age;
    public ReturnT grow()
    {
        age++;
        return this;//返回调用该方法的对象   链式调用
    }

    public static void main(String[] args) {
        ReturnT t=new ReturnT();
        t.grow().grow().grow();
        System.out.println("age成员变量值"+t.age);
    }
}
